// 分类模型
const { Cart } = require('../../../models/cart');
// 统一数据返回类
const { DataReturn } = require('../../../common/returnclass');

module.exports = async (req, res) => {
	// 用户id
	let { user_id } = req.query;
	console.log(req.query);
	
	let carts = await Cart.find({ user_id });
	
	if (!carts) return DataReturn.getData(res,200,[],'暂无数据')
	
	DataReturn.getData(res,200,carts,'查询购物车成功')
	
}